package com.goldwind.accompany.controller;

import com.goldwind.pojo.User;
import com.goldwind.user.service.userService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;


@Controller
public class PageController {

    @Autowired
    private userService service;

    @GetMapping("/accompany")
    public String showAccompanyPage(@RequestParam String email, Model model) {
        User user = service.selectByEmail(email);
        model.addAttribute("user1",user);
        return "accompany/accompany";
    }

    @GetMapping("/my-accompany")
    public String showMyAccompanyPage(@RequestParam String email,Model model) {
        User user = service.selectByEmail(email);
        model.addAttribute("user2",user);
        return "accompany/my-accompany";
    }

}
